import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

public class IOExc {
    public static void main(String[] args) {
        try (
                FileWriter fw = new FileWriter("IO/g.txt");
                FileReader fr = new FileReader("IO/f.txt");
                ) {
            int b;
            while ((b = fr.read()) != -1) {
                fw.write(b);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
